<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Servlet Testing Page</title>
</head>
<body>
Editing Tool is up and running!<BR>
<Table border=1>
<th colspan=2>HTTP Header</th>
<%@ page import="java.util.*" %>  
<% 
	Enumeration headerNames = request.getHeaderNames();
	while(headerNames.hasMoreElements())
    {
		String headerName = (String)headerNames.nextElement();
%>
	<TR><TD> <%=headerName %> </TD><TD> <%=(String) request.getHeader(headerName) %></TD></TR>
<%    
    }
%>
</Table>
<br>
<br>
<Table border=1>
<th colspan=2>Session Information</th>
<TR><TD>ID</TD><TD> <%=session.getId() %></TD></TR>
<TR><TD>IsNew?</TD><TD> <%=session.isNew() %></TD></TR>
<TR><TD>Creation Time</TD><TD> <%=session.getCreationTime() %></TD></TR>
<TR><TD>Last Access Time</TD><TD> <%=session.getLastAccessedTime() %></TD></TR>
<TR><TD>Max Inactive Interval</TD><TD> <%=session.getMaxInactiveInterval() %></TD></TR>
<TR><TD>Session Context</TD><TD> <%=session.getSessionContext() %></TD></TR>
<TR><TD>Data:</TD>
<TD>
<table border=1>
<%
	Enumeration sessionHeaders = session.getAttributeNames();
	while(sessionHeaders.hasMoreElements())
	{
		String sessionHeader = (String) sessionHeaders.nextElement();
		String sessionValue = (String) session.getAttribute(sessionHeader);
	%>
<TR><TD> <%=sessionHeader %> </TD><TD> <%=sessionValue %></TD></TR>
<%    
    }
%>
</table>
</TD>
</TR>
</Table>

<%
if(session.getAttribute("ldap")!=null)
{
	Hashtable ldap = (Hashtable) session.getAttribute("ldap");
	if(!ldap.isEmpty())
	{
%>
		<Table border=1>
		<th colspan=2>LDAP Information</th>
<%
		Enumeration ldapKeys = ldap.keys();
		while(ldapKeys.hasMoreElements())
		{
			String ldapKey = (String)ldapKeys.nextElement();
			String ldapValue = (String) ldap.get(ldapKey);
%>
		<TR><TD> <%=ldapKey %> </TD><TD> <%=ldapValue %></TD></TR>
<%    
    	}
%>
		</Table>
<%   
	}
}
%>
</body>
</html>